<?xml version="1.0" encoding="utf-8"?>
<openerp>
	<data>
		
		<report 
	       id="action_account_analytic_balance"
	       model="account.analytic.account"
	       string="Customer Quotation Print"
	       report_type="qweb-pdf"
	       name="batam_fast_module.ami_cust_quotation2"
	       file="batam_fast_module.ami_cust_quotation2"
	    />
		
		<record id="action_account_analytic_balance" model="ir.actions.report.xml">
	        <field name="paperformat_id" ref="batam_fast_module.paperformat_ami_invoice"/>
	    </record>
		
		<record id="account_analytic_analysis.action_account_analytic_overdue" model="ir.actions.act_window">
            <field name="name">Contracts</field>
            <field name="res_model">account.analytic.account</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="context">{}</field>
            <field name="domain">[('type','=','contract')]</field>
            <field name="search_view_id" ref="account_analytic_analysis.view_account_analytic_account_overdue_search"/>
            <field name="help" type="html">
              <p class="oe_view_nocontent_create">
                Click to define a new contract.
              </p><p>
                You will find here the contracts to be renewed because the
                end date is passed or the working effort is higher than the
                maximum authorized one.
              </p><p>
                Odoo automatically sets contracts to be renewed in a pending
                state. After the negociation, the salesman should close or renew
                pending contracts.
              </p>
            </field>
        </record>

		<record model="ir.ui.menu" id="project_timesheet.menu_invoicing_contracts">
		     <field name="name">Contracts</field>
		</record>
		
		<record id="project_timesheet.menu_project_billing_line" model="ir.ui.menu">
			<field name="groups_id" eval="[(6,0,[ref('applico_v8.hidden_applico')])]"/>
	    </record>

		<record id="account_analytic_account_form_form2_bf" model="ir.ui.view">
			<field name="name">account.analytic.account.invoice.form.inherit.bf</field>
			<field name="model">account.analytic.account</field>
			<field eval="100" name="priority"/>
			<field name="inherit_id" ref="account_analytic_analysis.account_analytic_account_form_form"/>
			<field name="arch" type="xml">
				<xpath expr='//separator[@name="toinvoice"]' position='replace'/>
				<table class="oe_form_analytic_account" position="replace">
					<table class="oe_form_analytic_account" invisible="1">
                        <tr>
                            <th class="oe_timesheet_grey" width="160px"></th>
                            <th class="oe_timesheet_grey" width="25px"></th>
                            <th class="oe_timesheet_grey" width="100px"><label string="Expected"/></th>
                            <th class="oe_timesheet_grey" width="100px"><label string="Invoiced"/></th>
                            <th class="oe_timesheet_grey" width="100px"><label string="Remaining"/></th>
                            <th class="oe_timesheet_grey" width="100px"><label string="To Invoice"/></th>
                            <th width="30px"></th>
                            <th></th>
                        </tr><tr>
                            <td class="oe_timesheet_grey">
                                <label for="fix_price_invoices"/>
                            </td><td class="oe_timesheet_grey">
                                <field name="fix_price_invoices" class="oe_inline"/>
                            </td><td>
                                <field class="oe_inline" name="amount_max" attrs="{'invisible': [('fix_price_invoices','=',False)]}"/>
                            </td><td>
                                <field class="oe_inline" name="ca_invoiced" attrs="{'invisible': [('fix_price_invoices','=',False)]}"/>
                            </td><td>
                                <field class="oe_inline" name="remaining_ca" attrs="{'invisible': [('fix_price_invoices','=',False)]}"/>
                            </td><td>
                                <field class="oe_inline" name="fix_price_to_invoice" attrs="{'invisible': [('fix_price_invoices','=',False)]}"/>
                            </td><td attrs="{'invisible': [('fix_price_invoices','=',False)]}" class="oe_timesheet_action">
                                <span attrs="{'invisible': [('fix_price_to_invoice','=',0.0)]}" class="oe_grey">
                                    <button name="open_sale_order_lines"
                                        class="oe_link"
                                        string="⇒ Invoice" type="object"
                                        context="{'default_partner_id': [partner_id],'default_project_id': active_id,'search_default_uninvoiced': 1,'search_default_project_id': active_id,'search_default_partner_id': [partner_id]}"/>
                                    or view
                                </span>

                                <span attrs="{'invisible': [('fix_price_to_invoice','&lt;&gt;',0.0 )]}" class="oe_grey">
                                    No order to invoice, create
                                </span>
                                <button name="%(account_analytic_analysis.action_sales_order)d" string="Sales Orders"
                                    type="action"
                                    class="oe_link"
                                    context="{'default_partner_id': [partner_id], 'search_default_project_id': [active_id],'default_project_id': [active_id], 'default_pricelist_id': pricelist_id}"
                                    />
                            </td>
                        </tr><tr>
                            <td class="oe_timesheet_grey">
                                <label for="invoice_on_timesheets"/>
                            </td><td class="oe_timesheet_grey">
                                <field name="invoice_on_timesheets" on_change="onchange_invoice_on_timesheets(invoice_on_timesheets)"/>
                            </td><td>
                                <field class="oe_inline" name="hours_qtt_est" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/>
                            </td><td>
                                <field class="oe_inline" name="timesheet_ca_invoiced" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/>
                            </td><td>
                                
                            </td><td>
                                <field class="oe_inline" name="ca_to_invoice" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/>
                            </td><td class="oe_timesheet_action" attrs="{'invisible': ['|',('invoice_on_timesheets','=',False),('type','=','template')]}">
                                <span attrs="{'invisible': [('ca_to_invoice','=',0.0)]}" class="oe_grey">
                                    <button name="hr_to_invoice_timesheets"
                                        type="object"
                                        class="oe_link"
                                        string="⇒ Invoice"/>
                                    or view 
                                </span>
                                <span attrs="{'invisible': [('ca_to_invoice','&lt;&gt;',0.0)]}" class="oe_grey">
                                    Nothing to invoice, create 
                                </span>

                                <button name="%(hr_timesheet.act_hr_timesheet_line_evry1_all_form)d"
                                    string="Timesheets" type="action"
                                    class="oe_link"
                                    context="{'default_account_id': active_id,'search_default_account_id': active_id}"/>
                            </td>
                        </tr><tr name='total'>
                            <th class="oe_timesheet_grey">
                                <label string="Total"/>
                            </th><td class="oe_timesheet_grey">
                            </td><td class="oe_timesheet_grey">
                                <field name="est_total" class="oe_inline" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/>
                            </td><td class="oe_timesheet_grey">
                                <field name="invoiced_total" class="oe_inline"/>
                            </td><td class="oe_timesheet_grey">
                                <field name="remaining_total" class="oe_inline"/>
                            </td><td class="oe_timesheet_grey">
                                <field name="toinvoice_total" class="oe_inline"/>
                            </td><td>
                            </td>
                        </tr>
                    </table>
				</table>
				<field name="pricelist_id"  position="replace">
					<field name="pricelist_id"
                                class="oe_inline"
                                attrs="{'required': [('invoice_on_timesheets', '=', True)]}"
                                invisible="1"
                                domain="[('type', '=', 'sale')]"/>
				</field>
				<div attrs="{'invisible': [('type','!=', 'contract'), ('recurring_invoices', '=', False)]}" position='replace'>
					<div invisible="1">
	                    <field name="recurring_invoices" on_change="onchange_recurring_invoices(recurring_invoices, date_start)" class="oe_inline" />
	                    <label for="recurring_invoices"/>
                    </div>
				</div>
			</field>
		</record>

		<record id="analytic_account_inherited_form_bf" model="ir.ui.view">
			<field name="name">account.analytic.account.form.inherit.bf</field>
			<field name="model">account.analytic.account</field>
			<field name="inherit_id" ref="project.analytic_account_inherited_form"/>
			<field name="arch" type="xml">
				<field name="use_tasks" position='replace'>
					<field name="use_tasks" invisible="1"/>
				</field>
				<label for="use_tasks" position='replace'>
					<label for="use_tasks" invisible="1"/>
				</label>
			</field>
		</record>

		<record id="view_account_analytic_account_form_bf" model="ir.ui.view">
			<field name="name">analytic.analytic.account.form.bf</field>
			<field name="model">account.analytic.account</field>
			<field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
			<field name="arch" type="xml">
				<field name="partner_id" position='replace'>
					<field name="partner_id" on_change="on_change_partner_id(partner_id, name)" invisible="1"/>
					<field name="billing_type"/>
				</field>
				<field name="type" position='replace'>
					<field name="type" invisible="1"/>
				</field>
				<field name="template_id" position='replace'>
					<field name="template_id" on_change="on_change_template(template_id, date_start)" domain="[('type','=','template')]" invisible="1" context="{'default_type' : 'template'}"/>
				</field>
				<group name="contract" position='replace'>
					<group string="Renewal" name="contract" invisible="1">
	                      <p colspan="2" class="oe_grey oe_edit_only">
	                          Once the end date of the contract is
	                          passed or the maximum number of service
	                          units (e.g. support contract) is
	                          reached, the account manager is notified 
	                          by email to renew the contract with the
	                          customer.
	                      </p>
	                      <field name="date_start"/>
	                      <label for="date" string="End Date"/>
	                      <div name="duration">
	                          <field name="date" class="oe_inline"/>
	                      </div>
                     </group>
				</group>
				<xpath expr='//notebook/page[@name="contract_page"]' position='after'>
					<page string="Quotation (Shipyard)" groups="batam_fast_module.group_ship_dept">
						<header>
							<button name="action_app_ship" string="Approved Quotation" attrs="{'invisible': [('ship_state', '=', 'approved')]}" context="{'type':'ship_state'}"
								type="object" class="oe_highlight" groups="project.group_project_manager"/>
							<button name="action_set_draft_ship" string="Set to Draft" attrs="{'invisible': [('ship_state', '=', 'draft')]}" context="{'type':'ship_state'}"
								type="object" class="oe_highlight" groups="project.group_project_manager"/>
						</header>
						<separator string="Estimated Labour Price"/>       
						<group>
	                        <group>
	                        	<field name="sy_normal_product_id" attrs="{'readonly': [('ship_state', '=', 'approved')]}"
	                        		on_change="onchange_product_id_normal(sy_normal_product_id,'sy_normal_price','sy_normal_cost')" domain="[('type','=','service')]"/>
	                            <field name="sy_normal_qty" attrs="{'readonly': [('ship_state', '=', 'approved')]}"/>
	                        	<field name="sy_normal_cost" attrs="{'readonly': [('ship_state', '=', 'approved')]}"/>
	                        	<field name="sy_ot_product_id" attrs="{'readonly': [('ship_state', '=', 'approved')]}"
									 on_change="onchange_product_id_ot(sy_ot_product_id,'sy_ot_price','sy_ot_cost')" domain="[('type','=','service')]"/>
								<field name="sy_ot_qty" attrs="{'readonly': [('ship_state', '=', 'approved')]}"/>
								<field name="sy_ot_cost" attrs="{'readonly': [('ship_state', '=', 'approved')]}"/>
	                        </group>
	                        <group>
	                        	<field name="sy_normal_price" attrs="{'readonly': [('ship_state', '=', 'approved')]}"/>
								<field name="sy_actual_normal_hours"/>
								<field name="sy_ot_price" attrs="{'readonly': [('ship_state', '=', 'approved')]}"/>
								<field name="sy_actual_ot_hours"/>

                        	</group>
                        	<group>
                        		<field name="sy_normal_invoice_qty"/>
                        		<field name="sy_ot_invoice_qty"/>
                        	</group>
                        </group>
						<separator string="Estimated Material Price"/>
						<field name="shipyard_line_ids" colspan="4" nolabel="1" height="140" attrs="{'readonly': [('ship_state', '=', 'approved')]}">
	                        <tree string="Shipyard" editable="bottom">
	                           	<field name="product_id" colspan="2" domain="[('type','=','product')]"  on_change="onchange_product_id(product_id)"/>
	                           	<field name="product_qty"/>
	                           	<field name="product_uom"/>
	                           	<field name="unit_price"/>
	                           	<field name="real_qty"/>
	                           	<field name="process_qty"/>
	                           	<field name="invoices_qty"/>
								<field name="deducted_quantity" string="Ded Qty"/>
	                           	<field name="type" invisible="1"/>
	                        </tree>
                        </field>
                        <separator string="Estimated Service Price"/>
						<field name="ship_service_line_ids" colspan="4" nolabel="1" height="140" attrs="{'readonly': [('ship_state', '=', 'approved')]}">
	                        <tree string="Shipyard" editable="bottom">
	                           	<field name="product_id" colspan="2" domain="[('type','=','service')]"  on_change="onchange_product_id(product_id)"/>
	                           	<field name="product_qty"/>
	                           	<field name="cost_price"/>
	                           	<field name="unit_price"/>
	                           	<field name="invoices_service_qty"/>
	                           	<field name="type" invisible="1"/>
	                        </tree>
                         </field>
                         <group>
                         	<field name="ship_state" readonly="1"/>
                         </group>
                     </page>
                     <page string="Quotation (Mechanical)" groups="batam_fast_module.group_mech_dept">
                     	<header>
							<button name="action_app_ship" string="Approved Quotation" attrs="{'invisible': [('mech_state', '=', 'approved')]}" context="{'type':'mech_state'}"
								type="object" class="oe_highlight" groups="project.group_project_manager"/>
							<button name="action_set_draft_ship" string="Set to Draft" attrs="{'invisible': [('mech_state', '=', 'draft')]}" context="{'type':'mech_state'}"
								type="object" class="oe_highlight" groups="project.group_project_manager"/>
						</header>
						<separator string="Estimated Labour Price"/>
							<group>
		                        <group>
		                            <field name="mech_normal_product_id" attrs="{'readonly': [('mech_state', '=', 'approved')]}"
		                            	on_change="onchange_product_id_normal(mech_normal_product_id,'mech_normal_price','mech_normal_cost')" domain="[('type','=','service')]"/>
		                            <field name="mech_normal_qty" attrs="{'readonly': [('mech_state', '=', 'approved')]}"/>
		                            <field name="mech_normal_cost" attrs="{'readonly': [('mech_state', '=', 'approved')]}"/>
		                            <field name="mech_ot_product_id" attrs="{'readonly': [('mech_state', '=', 'approved')]}"
										on_change="onchange_product_id_ot(mech_ot_product_id,'mech_ot_price','mech_ot_cost')" domain="[('type','=','service')]"/>
									<field name="mech_ot_qty" attrs="{'readonly': [('mech_state', '=', 'approved')]}"/>
									<field name="mech_ot_cost" attrs="{'readonly': [('mech_state', '=', 'approved')]}"/>
		                        </group>
		                        <group>
									<field name="mech_normal_price" attrs="{'readonly': [('mech_state', '=', 'approved')]}"/>
									<field name="mech_actual_normal_hours"/>
									<field name="mech_ot_price" attrs="{'readonly': [('mech_state', '=', 'approved')]}"/>
									<field name="mech_actual_ot_hours"/>
	                        	</group>
	                        	<group>
	                        		<field name="mech_normal_invoice_qty"/>
	                        		<field name="mech_ot_invoice_qty"/>
	                        	</group>
            				</group>
						<separator string="Estimated Material Price"/>
						<field name="mechanical_line_ids" colspan="4" nolabel="1" height="140" attrs="{'readonly': [('mech_state', '=', 'approved')]}">
	                        <tree string="Mechanical" editable="bottom">
	                           	<field name="product_id" colspan="2" domain="[('type','=','product')]"  on_change="onchange_product_id(product_id)"/>
	                           	<field name="product_qty"/>
	                           	<field name="product_uom"/>
	                           	<field name="unit_price"/>
	                           	<field name="real_qty"/>
	                           	<field name="process_qty"/>
	                           	<field name="invoices_qty"/>
								<field name="deducted_quantity" string="Ded Qty"/>
	                           	<field name="type" invisible="1"/>
	                        </tree>
                        </field>
                        <separator string="Estimated Service Price"/>
						<field name="mech_service_line_ids" colspan="4" nolabel="1" height="140" attrs="{'readonly': [('mech_state', '=', 'approved')]}">
	                        <tree string="Mechanical" editable="bottom">
	                           	<field name="product_id" colspan="2" domain="[('type','=','service')]"  on_change="onchange_product_id(product_id)"/>
	                           	<field name="product_qty"/>
	                           	<field name="cost_price"/>
	                           	<field name="unit_price"/>
	                           	<field name="invoices_service_qty"/>
	                           	<field name="type" invisible="1"/>
	                        </tree>
                         </field>
                         <group>
                         	<field name="mech_state" readonly="1"/>
                         </group>
                     </page>
                     <page string="Quotation (Electrical)" groups="batam_fast_module.group_elec_dept">
                     	<header>
							<button name="action_app_ship" string="Approved Quotation" attrs="{'invisible': [('elec_state', '=', 'approved')]}" context="{'type':'elec_state'}"
								type="object" class="oe_highlight" groups="project.group_project_manager"/>
							<button name="action_set_draft_ship" string="Set to Draft" attrs="{'invisible': [('elec_state', '=', 'draft')]}" context="{'type':'elec_state'}"
								type="object" class="oe_highlight" groups="project.group_project_manager"/>
						</header>
						<separator string="Estimated Labour Price"/>
							<group>
		                        <group>
		                            <field name="elec_normal_product_id" attrs="{'readonly': [('elec_state', '=', 'approved')]}"
		                            	on_change="onchange_product_id_normal(elec_normal_product_id,'elec_normal_price','elec_normal_cost')" domain="[('type','=','service')]"/>
		                            <field name="elec_normal_qty" attrs="{'readonly': [('elec_state', '=', 'approved')]}"/>
		                            <field name="elec_normal_cost" attrs="{'readonly': [('elec_state', '=', 'approved')]}"/>
		                            <field name="elec_ot_product_id" attrs="{'readonly': [('elec_state', '=', 'approved')]}"
										on_change="onchange_product_id_ot(elec_ot_product_id,'elec_ot_price','elec_ot_cost')" domain="[('type','=','service')]"/>
		                            <field name="elec_ot_qty" attrs="{'readonly': [('elec_state', '=', 'approved')]}"/>
		                        	<field name="elec_ot_cost" attrs="{'readonly': [('elec_state', '=', 'approved')]}"/>
		                        </group>
		                        <group>
		                        	<field name="elec_normal_price" attrs="{'readonly': [('elec_state', '=', 'approved')]}"/>
									<field name="elec_actual_normal_hours"/>
									<field name="elec_ot_price" attrs="{'readonly': [('elec_state', '=', 'approved')]}"/>
									<field name="elec_actual_ot_hours"/>
	                        	</group>
	                        	<group>
	                        		<field name="elec_normal_invoice_qty"/>
	                        		<field name="elec_ot_invoice_qty"/>
	                        	</group>
            				</group>
						<separator string="Estimated Material Price"/>
						<field name="electrical_line_ids" colspan="4" nolabel="1" height="140" attrs="{'readonly': [('elec_state', '=', 'approved')]}">
	                        <tree string="Electrical" editable="bottom">
	                           	<field name="product_id" colspan="2" domain="[('type','=','product')]"  on_change="onchange_product_id(product_id)"/>
	                           	<field name="product_qty"/>
	                           	<field name="product_uom"/>
	                           	<field name="unit_price"/>
	                           	<field name="real_qty"/>
	                           	<field name="process_qty"/>
	                           	<field name="invoices_qty"/>
								<field name="deducted_quantity" string="Ded Qty"/>
	                           	<field name="type" invisible="1"/>
	                        </tree>
                        </field>
                        <separator string="Estimated Service Price"/>
						<field name="elec_service_line_ids" colspan="4" nolabel="1" height="140" attrs="{'readonly': [('elec_state', '=', 'approved')]}">
	                        <tree string="Electrical" editable="bottom">
	                           	<field name="product_id" colspan="2" domain="[('type','=','service')]"  on_change="onchange_product_id(product_id)"/>
	                           	<field name="product_qty"/>
	                           	<field name="cost_price"/>
	                           	<field name="unit_price"/>
	                           	<field name="invoices_service_qty"/>
	                           	<field name="type" invisible="1"/>
	                        </tree>
                         </field>
                         <group>
                         	<field name="elec_state" readonly="1"/>
                         </group>
                     </page>
                     <page string="Quotation (Welding &amp; Fabrication)" groups="batam_fast_module.group_weld_dept">
                     	<header>
							<button name="action_app_ship" string="Approved Quotation" attrs="{'invisible': [('weld_state', '=', 'approved')]}" context="{'type':'weld_state'}"
								type="object" class="oe_highlight" groups="project.group_project_manager"/>
							<button name="action_set_draft_ship" string="Set to Draft" attrs="{'invisible': [('weld_state', '=', 'draft')]}" context="{'type':'weld_state'}"
								type="object" class="oe_highlight" groups="project.group_project_manager"/>
						</header>
						<separator string="Estimated Labour Price"/>
							<group>
		                        <group>
		                            <field name="weld_normal_product_id" attrs="{'readonly': [('weld_state', '=', 'approved')]}"
		                           		on_change="onchange_product_id_normal(weld_normal_product_id,'weld_normal_price','weld_normal_cost')" domain="[('type','=','service')]"/>
		                            <field name="weld_normal_qty" attrs="{'readonly': [('weld_state', '=', 'approved')]}"/>
		                            <field name="weld_normal_cost" attrs="{'readonly': [('weld_state', '=', 'approved')]}"/>
		                            <field name="weld_ot_product_id" attrs="{'readonly': [('weld_state', '=', 'approved')]}"
										on_change="onchange_product_id_ot(weld_ot_product_id,'weld_ot_price','weld_ot_cost')" domain="[('type','=','service')]"/>
									<field name="weld_ot_qty" attrs="{'readonly': [('weld_state', '=', 'approved')]}"/>
									<field name="weld_ot_cost" attrs="{'readonly': [('weld_state', '=', 'approved')]}"/>
		                        </group>
		                        <group>
		                        	<field name="weld_normal_price" attrs="{'readonly': [('weld_state', '=', 'approved')]}"/>
		                        	<field name="weld_actual_normal_hours"/>
		                        	<field name="weld_ot_price" attrs="{'readonly': [('weld_state', '=', 'approved')]}"/>
		                        	<field name="weld_actual_ot_hours"/>
	                        	</group>
	                        	<group>
	                        		<field name="weld_normal_invoice_qty"/>
	                        		<field name="weld_ot_invoice_qty"/>
	                        	</group>
            				</group>
						<separator string="Estimated Material Price" name="description"/>
						<field name="welding_line_ids" colspan="4" nolabel="1" height="140" attrs="{'readonly': [('weld_state', '=', 'approved')]}">
	                        <tree string="Welding &amp; Fabrication" editable="bottom">
	                           	<field name="product_id" colspan="2" domain="[('type','=','product')]"  on_change="onchange_product_id(product_id)"/>
	                           	<field name="product_qty"/>
	                           	<field name="product_uom"/>
	                           	<field name="unit_price"/>
	                           	<field name="real_qty"/>
	                           	<field name="process_qty"/>
	                           	<field name="invoices_qty"/>
								<field name="deducted_quantity" string="Ded Qty"/>
	                           	<field name="type" invisible="1"/>
	                        </tree>
                        </field>
                        <separator string="Estimated Service Price"/>
						<field name="weld_service_line_ids" colspan="4" nolabel="1" height="140" attrs="{'readonly': [('weld_state', '=', 'approved')]}">
	                        <tree string="Welding &amp; Fabrication" editable="bottom">
	                           	<field name="product_id" colspan="2" domain="[('type','=','service')]"  on_change="onchange_product_id(product_id)"/>
	                           	<field name="product_qty"/>
	                           	<field name="cost_price"/>
	                           	<field name="unit_price"/>
	                           	<field name="invoices_service_qty"/>
	                           	<field name="type" invisible="1"/>
	                        </tree>
                         </field>
                         <group>
                         	<field name="weld_state" readonly="1"/>
                         </group>
                     </page>
                     <page string="Quotation (Interior)" groups="batam_fast_module.group_int_dept">
                     	<header>
							<button name="action_app_ship" string="Approved Quotation" attrs="{'invisible': [('int_state', '=', 'approved')]}" context="{'type':'int_state'}"
								type="object" class="oe_highlight" groups="project.group_project_manager"/>
							<button name="action_set_draft_ship" string="Set to Draft" attrs="{'invisible': [('int_state', '=', 'draft')]}" context="{'type':'int_state'}"
								type="object" class="oe_highlight" groups="project.group_project_manager"/>
						</header>
						<separator string="Estimated Labour Price"/>
							<group>
		                        <group>
		                            <field name="int_normal_product_id" attrs="{'readonly': [('int_state', '=', 'approved')]}"
		                            	on_change="onchange_product_id_normal(int_normal_product_id,'int_normal_price','int_normal_cost')" domain="[('type','=','service')]"/>
		                            <field name="int_normal_qty" attrs="{'readonly': [('int_state', '=', 'approved')]}"/>
		                            <field name="int_normal_cost" attrs="{'readonly': [('int_state', '=', 'approved')]}"/>
		                            <field name="int_ot_product_id" attrs="{'readonly': [('int_state', '=', 'approved')]}"
										on_change="onchange_product_id_ot(int_ot_product_id,'int_ot_price','int_ot_cost')" domain="[('type','=','service')]"/>
									<field name="int_ot_qty" attrs="{'readonly': [('int_state', '=', 'approved')]}"/>
		                        	<field name="int_ot_cost" attrs="{'readonly': [('int_state', '=', 'approved')]}"/>
		                        </group>
		                        <group>
									<field name="int_normal_price" attrs="{'readonly': [('int_state', '=', 'approved')]}"/>
									<field name="int_actual_normal_hours"/>
									<field name="int_ot_price" attrs="{'readonly': [('int_state', '=', 'approved')]}"/>
									<field name="int_actual_ot_hours"/>
	                        	</group>
	                        	<group>
	                        		<field name="int_normal_invoice_qty"/>
	                        		<field name="int_ot_invoice_qty"/>
	                        	</group>		                        	
            				</group>
						<separator string="Estimated Material Price"/>
						<field name="interior_line_ids" colspan="4" nolabel="1" height="140" attrs="{'readonly': [('int_state', '=', 'approved')]}">
	                        <tree string="Interior" editable="bottom">
	                           	<field name="product_id" colspan="2" domain="[('type','=','product')]"  on_change="onchange_product_id(product_id)"/>
	                           	<field name="product_qty"/>
	                           	<field name="product_uom"/>
	                           	<field name="unit_price"/>
	                           	<field name="real_qty"/>
	                           	<field name="process_qty"/>
	                           	<field name="invoices_qty"/>
								<field name="deducted_quantity" string="Ded Qty"/>
	                           	<field name="type" invisible="1"/>
	                        </tree>
                        </field>
                        <separator string="Estimated Service Price"/>
						<field name="int_service_line_ids" colspan="4" nolabel="1" height="140" attrs="{'readonly': [('int_state', '=', 'approved')]}">
	                        <tree string="Interior" editable="bottom">
	                           	<field name="product_id" colspan="2" domain="[('type','=','service')]"  on_change="onchange_product_id(product_id)"/>
	                           	<field name="product_qty"/>
	                           	<field name="cost_price"/>
	                           	<field name="unit_price"/>
	                           	<field name="invoices_service_qty"/>
	                           	<field name="type" invisible="1"/>
	                        </tree>
                         </field>
                         <group>
                         	<field name="int_state" readonly="1"/>
                         </group>
                     </page>
					 <page string="Quotation (Design)" groups="batam_fast_module.group_desg_dept">
					 	<header>
							<button name="action_app_ship" string="Approved Quotation" attrs="{'invisible': [('desg_state', '=', 'approved')]}" context="{'type':'desg_state'}"
								type="object" class="oe_highlight" groups="project.group_project_manager"/>
							<button name="action_set_draft_ship" string="Set to Draft" attrs="{'invisible': [('desg_state', '=', 'draft')]}" context="{'type':'desg_state'}"
								type="object" class="oe_highlight" groups="project.group_project_manager"/>
						</header>
						<separator string="Estimated Labour Price"/>
							<group>
		                        <group>
		                            <field name="desg_normal_product_id" attrs="{'readonly': [('desg_state', '=', 'approved')]}"
		                            	on_change="onchange_product_id_normal(desg_normal_product_id,'desg_normal_price','desg_normal_cost')" domain="[('type','=','service')]"/>
		                            <field name="desg_normal_qty" attrs="{'readonly': [('desg_state', '=', 'approved')]}"/>
		                            <field name="desg_normal_cost" attrs="{'readonly': [('desg_state', '=', 'approved')]}"/>
		                            <field name="desg_ot_product_id" attrs="{'readonly': [('desg_state', '=', 'approved')]}"
										on_change="onchange_product_id_ot(desg_ot_product_id,'desg_ot_price','desg_ot_cost')" domain="[('type','=','service')]"/>
									<field name="desg_ot_qty" attrs="{'readonly': [('desg_state', '=', 'approved')]}"/>
		                        	<field name="desg_ot_cost" attrs="{'readonly': [('desg_state', '=', 'approved')]}"/>
		                        </group>
		                        <group>
									<field name="desg_normal_price" attrs="{'readonly': [('desg_state', '=', 'approved')]}"/>
									<field name="desg_actual_normal_hours"/>
									<field name="desg_ot_price" attrs="{'readonly': [('desg_state', '=', 'approved')]}"/>
									<field name="desg_actual_ot_hours"/>
	                        	</group>
	                        	<group>
	                        		<field name="desg_normal_invoice_qty"/>
	                        		<field name="desg_ot_invoice_qty"/>
	                        	</group>
            				</group>
						<separator string="Estimated Material Price"/>
						<field name="design_line_ids" colspan="4" nolabel="1" height="140" attrs="{'readonly': [('desg_state', '=', 'approved')]}">
	                        <tree string="Design" editable="bottom">
	                           	<field name="product_id" colspan="2" domain="[('type','=','product')]"  on_change="onchange_product_id(product_id)"/>
	                           	<field name="product_qty"/>
	                           	<field name="product_uom"/>
	                           	<field name="unit_price"/>
	                           	<field name="real_qty"/>
	                           	<field name="process_qty"/>
	                           	<field name="invoices_qty"/>
								<field name="deducted_quantity" string="Ded Qty"/>
	                           	<field name="type" invisible="1"/>
	                        </tree>
                        </field>
                        <separator string="Estimated Service Price"/>
						<field name="desg_service_line_ids" colspan="4" nolabel="1" height="140" attrs="{'readonly': [('desg_state', '=', 'approved')]}">
	                        <tree string="Design" editable="bottom">
	                           	<field name="product_id" colspan="2" domain="[('type','=','service')]"  on_change="onchange_product_id(product_id)"/>
	                           	<field name="product_qty"/>
	                           	<field name="cost_price"/>
	                           	<field name="unit_price"/>
	                           	<field name="invoices_service_qty"/>
	                           	<field name="type" invisible="1"/>
	                        </tree>
                         </field>
                         <group>
                         	<field name="desg_state" readonly="1"/>
                         </group>
                     </page>
                     <page string="Quotation (Other Dept1)" groups="batam_fast_module.group_dept1_dept">
                     	<header>
							<button name="action_app_ship" string="Approved Quotation" attrs="{'invisible': [('dept1_state', '=', 'approved')]}" context="{'type':'dept1_state'}"
								type="object" class="oe_highlight" groups="project.group_project_manager"/>
							<button name="action_set_draft_ship" string="Set to Draft" attrs="{'invisible': [('dept1_state', '=', 'draft')]}" context="{'type':'dept1_state'}"
								type="object" class="oe_highlight" groups="project.group_project_manager"/>
						</header>
						<separator string="Estimated Labour Price"/>
							<group>
		                        <group>
		                            <field name="dept1_normal_product_id" attrs="{'readonly': [('dept1_state', '=', 'approved')]}"
		                            	on_change="onchange_product_id_normal(dept1_normal_product_id,'dept1_normal_price','dept1_normal_cost')" domain="[('type','=','service')]"/>
		                            <field name="dept1_normal_qty" attrs="{'readonly': [('dept1_state', '=', 'approved')]}"/>
		                            <field name="dept1_normal_cost" attrs="{'readonly': [('dept1_state', '=', 'approved')]}"/>
		                            <field name="dept1_ot_product_id" attrs="{'readonly': [('dept1_state', '=', 'approved')]}"
										on_change="onchange_product_id_ot(dept1_ot_product_id,'dept1_ot_price','dept1_ot_cost')" domain="[('type','=','service')]"/>
									<field name="dept1_ot_qty" attrs="{'readonly': [('dept1_state', '=', 'approved')]}"/>
		                        	<field name="dept1_ot_cost" attrs="{'readonly': [('dept1_state', '=', 'approved')]}"/>
		                        </group>
		                        <group>
									<field name="dept1_normal_price" attrs="{'readonly': [('dept1_state', '=', 'approved')]}"/>
									<field name="dept1_actual_normal_hours"/>
									<field name="dept1_ot_price" attrs="{'readonly': [('dept1_state', '=', 'approved')]}"/>
									<field name="dept1_actual_ot_hours"/>
	                        	</group>
	                        	<group>
	                        		<field name="dept1_normal_invoice_qty"/>
	                        		<field name="dept1_ot_invoice_qty"/>
	                        	</group>		                        	
            				</group>
						<separator string="Estimated Material Price"/>
						<field name="department1_line_ids" colspan="4" nolabel="1" height="140" attrs="{'readonly': [('dept1_state', '=', 'approved')]}">
	                        <tree string="Department1" editable="bottom">
	                           	<field name="product_id" colspan="2" domain="[('type','=','product')]"  on_change="onchange_product_id(product_id)"/>
	                           	<field name="product_qty"/>
	                           	<field name="product_uom"/>
	                           	<field name="unit_price"/>
	                           	<field name="real_qty"/>
	                           	<field name="process_qty"/>
	                           	<field name="invoices_qty"/>
								<field name="deducted_quantity" string="Ded Qty"/>
	                           	<field name="type" invisible="1"/>
	                        </tree>
                        </field>
                        <separator string="Estimated Service Price"/>
						<field name="dept1_service_line_ids" colspan="4" nolabel="1" height="140" attrs="{'readonly': [('dept1_state', '=', 'approved')]}">
	                        <tree string="Department1" editable="bottom">
	                           	<field name="product_id" colspan="2" domain="[('type','=','service')]"  on_change="onchange_product_id(product_id)"/>
	                           	<field name="product_qty"/>
	                           	<field name="cost_price"/>
	                           	<field name="unit_price"/>
	                           	<field name="invoices_service_qty"/>
	                           	<field name="type" invisible="1"/>
	                        </tree>
                         </field>
                         <group>
                         	<field name="dept1_state" readonly="1"/>
                         </group>
                     </page>
                     <page string="Quotation (Other Dept2)" groups="batam_fast_module.group_dept2_dept">
                     	<header>
							<button name="action_app_ship" string="Approved Quotation" attrs="{'invisible': [('dept2_state', '=', 'approved')]}" context="{'type':'dept2_state'}"
								type="object" class="oe_highlight" groups="project.group_project_manager"/>
							<button name="action_set_draft_ship" string="Set to Draft" attrs="{'invisible': [('dept2_state', '=', 'draft')]}" context="{'type':'dept2_state'}"
								type="object" class="oe_highlight" groups="project.group_project_manager"/>
						</header>
						<separator string="Estimated Labour Price"/>
							<group>
		                        <group>
		                            <field name="dept2_normal_product_id" attrs="{'readonly': [('dept2_state', '=', 'approved')]}"
		                            	on_change="onchange_product_id_normal(dept2_normal_product_id,'dept2_normal_price','dept2_normal_cost')" domain="[('type','=','service')]"/>
		                            <field name="dept2_normal_qty" attrs="{'readonly': [('dept2_state', '=', 'approved')]}"/>
		                            <field name="dept2_normal_cost" attrs="{'readonly': [('dept2_state', '=', 'approved')]}"/>
		                            <field name="dept2_ot_product_id" attrs="{'readonly': [('dept2_state', '=', 'approved')]}"
										on_change="onchange_product_id_ot(dept2_ot_product_id,'dept2_ot_price','dept2_ot_cost')" domain="[('type','=','service')]"/>
									<field name="dept2_ot_qty" attrs="{'readonly': [('dept2_state', '=', 'approved')]}"/>
		                        	<field name="dept2_ot_cost" attrs="{'readonly': [('dept2_state', '=', 'approved')]}"/>
		                        </group>
		                        <group>
									<field name="dept2_normal_price" attrs="{'readonly': [('dept2_state', '=', 'approved')]}"/>
									<field name="dept2_actual_normal_hours"/>
									<field name="dept2_ot_price" attrs="{'readonly': [('dept2_state', '=', 'approved')]}"/>
									<field name="dept2_actual_ot_hours"/>
	                        	</group>
	                        	<group>
	                        		<field name="dept2_normal_invoice_qty"/>
	                        		<field name="dept2_ot_invoice_qty"/>
	                        	</group>		                        	
            				</group>
						<separator string="Estimated Material Price"/>
						<field name="department2_line_ids" colspan="4" nolabel="1" height="140" attrs="{'readonly': [('dept2_state', '=', 'approved')]}">
	                        <tree string="Department2" editable="bottom">
	                           	<field name="product_id" colspan="2" domain="[('type','=','product')]"  on_change="onchange_product_id(product_id)"/>
	                           	<field name="product_qty"/>
	                           	<field name="product_uom"/>
	                           	<field name="unit_price"/>
	                           	<field name="real_qty"/>
	                           	<field name="process_qty"/>
	                           	<field name="invoices_qty"/>
								<field name="deducted_quantity" string="Ded Qty"/>
	                           	<field name="type" invisible="1"/>
	                        </tree>
                        </field>
                        <separator string="Estimated Service Price"/>
						<field name="dept2_service_line_ids" colspan="4" nolabel="1" height="140" attrs="{'readonly': [('dept2_state', '=', 'approved')]}">
	                        <tree string="Department2" editable="bottom">
	                           	<field name="product_id" colspan="2" domain="[('type','=','service')]"  on_change="onchange_product_id(product_id)"/>
	                           	<field name="product_qty"/>
	                           	<field name="cost_price"/>
	                           	<field name="unit_price"/>
	                           	<field name="invoices_service_qty"/>
	                           	<field name="type" invisible="1"/>
	                        </tree>
                         </field>
                         <group>
                         	<field name="dept2_state" readonly="1"/>
                         </group>
                     </page>
                     <page string="Quotation (Other Dept3)" groups="batam_fast_module.group_dept3_dept">
                     	<header>
							<button name="action_app_ship" string="Approved Quotation" attrs="{'invisible': [('dept3_state', '=', 'approved')]}" context="{'type':'dept3_state'}"
								type="object" class="oe_highlight" groups="project.group_project_manager"/>
							<button name="action_set_draft_ship" string="Set to Draft" attrs="{'invisible': [('dept3_state', '=', 'draft')]}" context="{'type':'dept3_state'}"
								type="object" class="oe_highlight" groups="project.group_project_manager"/>
						</header>
						<separator string="Estimated Labour Price"/>
							<group>
		                        <group>
		                            <field name="dept3_normal_product_id" attrs="{'readonly': [('dept3_state', '=', 'approved')]}"
		                            	on_change="onchange_product_id_normal(dept3_normal_product_id,'dept3_normal_price','dept3_normal_cost')" domain="[('type','=','service')]"/>
		                            <field name="dept3_normal_qty" attrs="{'readonly': [('dept3_state', '=', 'approved')]}"/>
		                            <field name="dept3_normal_cost" attrs="{'readonly': [('dept3_state', '=', 'approved')]}"/>
		                            <field name="dept3_ot_product_id" attrs="{'readonly': [('dept3_state', '=', 'approved')]}"
										on_change="onchange_product_id_ot(dept3_ot_product_id,'dept3_ot_price','dept3_ot_cost')" domain="[('type','=','service')]"/>
									<field name="dept3_ot_qty" attrs="{'readonly': [('dept3_state', '=', 'approved')]}"/>
		                        	<field name="dept3_ot_cost" attrs="{'readonly': [('dept3_state', '=', 'approved')]}"/>
		                        </group>
		                        <group>
									<field name="dept3_normal_price" attrs="{'readonly': [('dept3_state', '=', 'approved')]}"/>
									<field name="dept3_actual_normal_hours"/>
									<field name="dept3_ot_price" attrs="{'readonly': [('dept3_state', '=', 'approved')]}"/>
									<field name="dept3_actual_ot_hours"/>
	                        	</group>
	                        	<group>
	                        		<field name="dept3_normal_invoice_qty"/>
	                        		<field name="dept3_ot_invoice_qty"/>
	                        	</group>		                        	
            				</group>
						<separator string="Estimated Material Price"/>
						<field name="department3_line_ids" colspan="4" nolabel="1" height="140" attrs="{'readonly': [('dept3_state', '=', 'approved')]}">
	                        <tree string="Department3" editable="bottom">
	                           	<field name="product_id" colspan="2" domain="[('type','=','product')]"  on_change="onchange_product_id(product_id)"/>
	                           	<field name="product_qty"/>
	                           	<field name="product_uom"/>
	                           	<field name="unit_price"/>
	                           	<field name="real_qty"/>
	                           	<field name="process_qty"/>
	                           	<field name="invoices_qty"/>
								<field name="deducted_quantity" string="Ded Qty"/>
	                           	<field name="type" invisible="1"/>
	                        </tree>
                        </field>
                        <separator string="Estimated Service Price"/>
						<field name="dept3_service_line_ids" colspan="4" nolabel="1" height="140" attrs="{'readonly': [('dept3_state', '=', 'approved')]}">
	                        <tree string="Department3" editable="bottom">
	                           	<field name="product_id" colspan="2" domain="[('type','=','service')]"  on_change="onchange_product_id(product_id)"/>
	                           	<field name="product_qty"/>
	                           	<field name="cost_price"/>
	                           	<field name="unit_price"/>
	                           	<field name="invoices_service_qty"/>
	                           	<field name="type" invisible="1"/>
	                        </tree>
                         </field>
                         <group>
                         	<field name="dept3_state" readonly="1"/>
                         </group>
                     </page>
                     <page string="History">
                     	<separator string="Internal Move History"/>
                     	<field name="int_move_ids" nolabel="1" widget="one2many_list">
			                <form string="Internal Move Details">
			                <header>
								<field name="state" widget="statusbar" statusbar_visible="assigned,done" statusbar_colors="{'shipping_except':'red','invoice_except':'red','waiting_date':'blue'}" modifiers="{'readonly': true}"/>
							</header>
							<sheet>
								<h1>
									<field name="name" class="oe_inline" attrs="{'invisible': [('name','=','/')]}" readonly="1"/>
								</h1>
								<group>
									<group>
										<field name="partner_id" invisible="1"/>
										<field name="project_id2" required="1" domain="[('state','not in', ('close', 'cancelled'))]" modifiers="{'readonly': [['state', 'in', ['cancel', 'assigned', 'done']]], 'required': true}"/>
										<field name="department" required="1" modifiers="{'readonly': [['state', 'in', ['cancel', 'assigned', 'done']]], 'required': true}"/>
										<field name="requestor_id" modifiers="{}"/>
										<field name="backorder_id" readonly="1" attrs="{'invisible': [('backorder_id','=',False)]}"/>
									</group>
									<group>
										<field name="date"/>
										<field name="min_date" invisible="1"/>
										<field name="origin" placeholder="e.g. PO0032" class="oe_inline"/>
										<field name="gate_pass" modifiers="{}"/>
										<field name="gate_pass_state" readonly="1" modifiers="{'readonly': true}"/>
									</group>
								</group>
								<notebook>
									<page string="Products">
										<separator string="Stock Moves" attrs="{'invisible': [('pack_operation_exist', '=', False)]}"/>
										<field name="move_lines" attrs="{'readonly': [('state','!=','draft')]}" context="{'address_in_id': partner_id, 'form_view_ref':'applico_v8.view_move_internal_picking_form', 'tree_view_ref':'applico_v8.view_move_internal_picking_tree', 'default_picking_type_id': picking_type_id,'default_picking_id': active_id}"/>
										<field name="pack_operation_exist" invisible="1"/>
										<field name="note" placeholder="Add an internal note..." class="oe_inline"/>
									</page>
									<page string="Operations" attrs="{'invisible': ['|', ('state','!=','done'), ('pack_operation_ids','=',[])]}">
										<field name="pack_operation_ids" context="{'default_picking_id': active_id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id}">
											<tree editable="top">
												<field name="package_id" groups="stock.group_tracking_lot"/>
												<field name="product_id" on_change="product_id_change(product_id, product_uom_id, product_qty)"/>
												<field name="product_uom_id" groups="product.group_uom"/>
												<field name="lot_id" domain="[('product_id','=?', product_id)]" context="{'product_id': product_id}" groups="stock.group_production_lot"/>
												<field name="picking_id" invisible="1"/>
												<field name="owner_id" groups="stock.group_tracking_owner"/>
												<field name="product_qty" attrs="{'required': [('product_id', '!=', False)]}"/>
												<field name="location_id" domain="[('id', 'child_of', parent.location_id)]"/>
												<field name="location_dest_id" domain="[('id', 'child_of', parent.location_dest_id)]"/>
												<field name="result_package_id" groups="stock.group_tracking_lot" context="{'location_id': location_dest_id}"/>
											</tree>
										</field>
										<p class="oe_grey" groups="stock.group_tracking_lot">
											If there is no product but a source package, this means the source package was moved entirely.  If there is a product and a source package, the product was taken from the source package.  
										</p>
									</page>
									<page string="Additional Info">
										<group string="General Informations">
											<group>
												<field name="move_type" invisible="1"/>
												<field name="invoice_state" readonly="1" groups="account.group_account_invoice"/>
												<field name="picking_type_id" readonly="1"/>
												<field name="allow_create" invisible="1"/>
												<field name="picking_type_code" invisible="1"/>
												<field name="quant_reserved_exist" invisible="1"/>
												<field name="location_id" invisible="1"/>
												<field name="location_dest_id" invisible="1"/>
											</group>
											<group>
												<field name="company_id" groups="base.group_multi_company" widget="selection"/>
												<field name="date_done" groups="base.group_no_one"/>
												<field name="group_id"/>
												<field name="priority"/>
											</group>
										</group>
									</page>
								</notebook>
							</sheet>
							</form>
							<tree colors="blue:state == 'draft';grey:state == 'cancel';red:state not in ('cancel', 'done') and min_date &lt; current_date" string="Picking list">
			                    <field name="name"/>
			                    <field name="location_dest_id"/>
			                    <field name="partner_id"/>
			                    <field name="date"/>
			                    <field name="min_date" invisible="1"/>
			                    <field name="origin"/>
			                    <field name="group_id" invisible="1"/>
			                    <field name="backorder_id"/>
			                    <field name="state"/>
			                    <field name="priority" invisible="1"/>
			                    <field name="picking_type_id" invisible="1"/>
			                </tree>
                     	</field>
                     	<separator string="Adjustment Reduction History"/>
                     	<field name="reduction_ids" nolabel="1"  widget="one2many_list">
                     		<form string="Inventory Adjustment">
								<header>
									<field name="state" widget="statusbar" statusbar_visible="draft,done" modifiers="{'readonly': true}"/>
								</header>
								<sheet>
									<div class="oe_title">
										<label for="name" class="oe_edit_only"/>
										<h1>
											<field name="name" required="0" readonly="1" placeholder="e.g. Annual inventory" modifiers="{'readonly': true}"/>
										</h1>
									</div>
									<group>
										<group>
											<field name="reason" modifiers="{}"/>
											<field name="location_id" domain="[('usage','=','internal')]" modifiers="{'readonly': [['state', 'not in', ['draft']]], 'required': true}"/>
											<field name="filter" invisible="1" string="Inventory of" widget="radio" attrs="{'readonly': [('state', '!=', 'draft')]}" modifiers="{'invisible': true, 'readonly': [['state', '!=', 'draft']], 'required': true}"/>
										</group>
										<group>
											<field name="date" readonly="0" modifiers="{'required': true}"/>
											<field name="int_type_id" modifiers="{'readonly': [['state', 'in', ['done']]], 'required': true}"/>
											<field name="analytic_account_id" readonly="0" modifiers="{}"/>
											<field name="period_id" invisible="1" modifiers="{'invisible': true}"/>
											<field name="company_id" widget="selection" invisible="1" modifiers="{'invisible': true, 'readonly': [['state', 'not in', ['draft']]], 'required': true}"/>
											<field name="product_id" domain="[('type','=','product')]" attrs="{'invisible': [('filter', 'not in', ('product', 'product_owner'))]}" modifiers="{'invisible': [['filter', 'not in', ['product', 'product_owner']]], 'readonly': [['state', 'not in', ['draft']]]}"/>
											<field name="lot_id" invisible="1" modifiers="{'invisible': true, 'readonly': [['state', 'not in', ['draft']]]}"/>
											<field name="partner_id" invisible="1" modifiers="{'invisible': true, 'readonly': [['state', 'not in', ['draft']]]}"/>
											<field name="package_id" invisible="1" modifiers="{'invisible': true, 'readonly': [['state', 'not in', ['draft']]]}"/>
										</group>
									</group>
									<notebook>
										<page string="Inventory Details">
											<field name="line_ids" string="Inventory Details" context="{'default_location_id': location_id,  'default_product_id': product_id, 'default_prod_lot_id': lot_id, 'default_package_id': package_id, 'default_partner_id': partner_id}" modifiers="{'readonly': [['state', 'in', ['done']]]}"/>
										</page>
										<page string="Inventory Adjustments" attrs="{'invisible': [('state', '!=', 'done')]}" modifiers="{'invisible': [['state', '!=', 'done']]}">
											<field name="move_ids" modifiers="{'readonly': true}"/>
										</page>
										<page string="Other Information">
											<group>
												<field name="approved_zero" invisible="1" modifiers="{'invisible': true}"/>
												<field name="zero_approver" readonly="1" modifiers="{'readonly': true}"/>
												<field name="zero_date" readonly="1" modifiers="{'readonly': true}"/>
											</group>
										</page>
									</notebook>
								</sheet>
							</form>
                     		<tree string="Lot Inventory" colors="grey:state == 'cancel'">
								<field name="name" modifiers="{'readonly': [['state', 'not in', ['draft']]], 'required': true}"/>
								<field name="date" modifiers="{'readonly': true, 'required': true}"/>
								<field name="state" modifiers="{'readonly': true}"/>
							</tree>
                     	</field>
                     	<separator string="Invoice History"/>
                     	<field name="invoice_ids" nolabel="1" widget="one2many_list">
                     		<tree colors="blue:state == 'draft';black:state in ('proforma','proforma2','open');gray:state == 'cancel'" string="Invoice">
								<field name="internal_number" modifiers="{'readonly': true}"/>
								<field name="date_invoice" modifiers="{'readonly': [['state', 'not in', ['draft']]]}"/>
								<field name="partner_id" on_change="1" modifiers="{'readonly': [['state', 'not in', ['draft']]], 'required': true}" string="Customer"/>
								<field name="commercial_partner_id" invisible="1" modifiers="{'readonly': true, 'tree_invisible': true}"/>
								<field name="number" invisible="1" modifiers="{'readonly': true, 'tree_invisible': true}"/>
								<field name="reference" invisible="1" modifiers="{'tree_invisible': true}"/>
								<field name="name" invisible="1" modifiers="{'readonly': [['state', 'not in', ['draft']]], 'tree_invisible': true}"/>
								<field name="journal_id" invisible="1" modifiers="{'readonly': [['state', 'not in', ['draft']]], 'required': true, 'tree_invisible': true}"/>
								<field name="period_id" invisible="1" modifiers="{'readonly': [['state', 'not in', ['draft']]], 'tree_invisible': true}"/>
								<field name="company_id" widget="selection" invisible="1" modifiers="{'invisible': true, 'readonly': [['state', 'not in', ['draft']]], 'required': true, 'tree_invisible': true}"/>
								<field name="user_id" string="Responsible" modifiers="{'readonly': [['state', 'not in', ['draft']]]}"/>
								<field name="section_id" string="Sales Team" invisible="1" modifiers="{'invisible': true, 'tree_invisible': true}"/>
								<field name="date_due" modifiers="{'readonly': [['state', 'not in', ['draft']]]}"/>
								<field name="origin" modifiers="{'readonly': [['state', 'not in', ['draft']]]}"/>
								<field name="currency_id" on_change="1" modifiers="{'readonly': [['state', 'not in', ['draft']]], 'required': true}"/>
								<field name="residual" sum="Residual Amount" modifiers="{'readonly': true}"/>
								<field name="amount_untaxed" sum="Untaxed Amount" modifiers="{'readonly': true}"/>
								<field name="amount_total" sum="Total Amount" modifiers="{'readonly': true}"/>
								<field name="state" on_change="1" modifiers="{'readonly': true}"/>
							</tree>
							<form string="Invoice">
								<header>
									<field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,open,paid" statusbar_colors="{'proforma':'blue','proforma2':'blue'}" on_change="1" modifiers="{'readonly': true}"/>
								</header>
								<sheet string="Invoice">
									<h1>
										<label string="Draft Invoice" attrs="{'invisible': ['|',('state','not in',('draft',)), ('type','&lt;&gt;','out_invoice')]}" modifiers="{'invisible': ['|', ['state', 'not in', ['draft']], ['type', '&lt;&gt;', 'out_invoice']]}"/>
										<label string="Draft Refund" attrs="{'invisible': ['|',('state','not in',('draft',)), ('type','&lt;&gt;','out_refund')]}" modifiers="{'invisible': ['|', ['state', 'not in', ['draft']], ['type', '&lt;&gt;', 'out_refund']]}"/>
										<label string="Pro Forma Invoice" attrs="{'invisible': [('state','not in',('proforma','proforma2'))]}" modifiers="{'invisible': [['state', 'not in', ['proforma', 'proforma2']]]}"/>
										<label string="Invoice" attrs="{'invisible': ['|',('state','in',('draft','proforma','proforma2')), ('type','&lt;&gt;','out_invoice')]}" modifiers="{'invisible': ['|', ['state', 'in', ['draft', 'proforma', 'proforma2']], ['type', '&lt;&gt;', 'out_invoice']]}"/>
										<label string="Refund" attrs="{'invisible': ['|',('state','in',('draft','proforma','proforma2')), ('type','&lt;&gt;','out_refund')]}" modifiers="{'invisible': ['|', ['state', 'in', ['draft', 'proforma', 'proforma2']], ['type', '&lt;&gt;', 'out_refund']]}"/>
										<field name="number" class="oe_inline" invisible="1" modifiers="{'invisible': true, 'readonly': true}"/>
										<field name="internal_number" class="oe_inline" attrs="{'invisible': [('state', '=', 'draft')]}" modifiers="{'invisible': [['state', '=', 'draft']], 'readonly': true}"/>
									</h1>
									<field name="type" invisible="1" on_change="1" modifiers="{'invisible': true, 'readonly': true}"/>
									<group>
										<group>
											<field string="Customer" name="partner_id" on_change="onchange_partner_id(type, partner_id, date_invoice, payment_term, partner_bank_id, company_id, context)" context="{'search_default_customer':1, 'show_address': 1}" options="{'always_reload': True}" domain="[('customer', '=', True)]" modifiers="{'readonly': [['state', 'not in', ['draft']]], 'required': true}"/>
											<field name="fiscal_position" options="{'no_create': True}" modifiers="{'readonly': [['state', 'not in', ['draft']]]}"/>
										</group>
										<group>
											<field name="date_invoice" on_change="onchange_payment_term_date_invoice(payment_term, date_invoice)" modifiers="{'readonly': [['state', 'not in', ['draft']]]}"/>
											<field name="journal_id" on_change="onchange_journal_id(journal_id)" options="{'no_create': True}" modifiers="{'readonly': [['state', 'not in', ['draft']]], 'required': true}"/>
											<field domain="[('company_id', '=', company_id),('type','=', 'receivable')]" name="account_id" on_change="1" modifiers="{'readonly': [['state', 'not in', ['draft']]], 'required': true}"/>
											<label for="currency_id"/>
											<div>
												<field name="currency_id" class="oe_inline" on_change="1" modifiers="{'readonly': [['state', 'not in', ['draft']]], 'required': true}"/>
												<field name="cur_rate" modifiers="{'readonly': true}"/>
											</div>
										</group>
									</group>
									<field name="sent" invisible="1" modifiers="{'invisible': true, 'readonly': true}"/>
									<field name="portal_payment_options" class="view_portal_payment_options" invisible="1" modifiers="{'invisible': true, 'readonly': true}"/>
									<notebook colspan="4">
										<page string="Invoice Lines">
											<field name="invoice_line" nolabel="1" widget="one2many_list" context="{'type': type}" on_change="1" modifiers="{'readonly': [['state', 'not in', ['draft']]]}"/>
											<group class="oe_subtotal_footer oe_right">
												<field name="amount_untaxed" widget="monetary" options="{'currency_field': 'currency_id'}" modifiers="{'readonly': true}"/>
												<div>
													<label for="amount_tax"/>
												</div>
												<field name="amount_tax" nolabel="1" widget="monetary" options="{'currency_field': 'currency_id'}" modifiers="{'readonly': true}"/>
												<field name="amount_total" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}" modifiers="{'readonly': true}"/>
												<field name="residual" widget="monetary" options="{'currency_field': 'currency_id'}" modifiers="{'readonly': true}"/>
												<field name="reconciled" invisible="1" modifiers="{'invisible': true, 'readonly': true}"/>
											</group>
											<group>
												<field name="payment_term" class="oe_inline" modifiers="{'readonly': [['state', 'not in', ['draft']]]}"/>
											</group>
											<div class="oe_clear">
												<label for="comment"/>
											</div>
											<field name="comment" class="oe_inline" placeholder="Additional notes..." modifiers="{}"/>
										</page>
										<page string="Other Info">
											<group col="4">
												<group>
													<field name="company_id" on_change="onchange_company_id(company_id,partner_id,type,invoice_line,currency_id)" widget="selection" invisible="1" modifiers="{'invisible': true, 'readonly': [['state', 'not in', ['draft']]], 'required': true}"/>
													<field name="user_id" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'account.group_account_invoice']}" modifiers="{'readonly': [['state', 'not in', ['draft']]]}"/>
													<field name="section_id" invisible="1" modifiers="{'invisible': true}"/>
													<field domain="[('partner_id.ref_companies', 'in', [company_id])]" name="partner_bank_id" invisible="1" modifiers="{'invisible': true, 'readonly': [['state', 'not in', ['draft']]]}"/>
													<field name="period_id" domain="[('state', '=', 'draft'), ('company_id', '=', company_id)]" string="Accounting Period" placeholder="force period" modifiers="{'readonly': [['state', 'not in', ['draft']]]}"/>
													<field name="date_due" modifiers="{'readonly': [['state', 'not in', ['draft']]]}"/>
													<field name="change_rate" modifiers="{'readonly': [['state', 'not in', ['draft']]]}"/>
												</group>
												<group>
													<field name="origin" modifiers="{'readonly': [['state', 'not in', ['draft']]]}"/>
													<field name="name" modifiers="{'readonly': [['state', 'not in', ['draft']]]}"/>
													<field name="move_id" on_change="1" modifiers="{'readonly': true}"/>
												</group>
											</group>
											<!-- <field name="tax_line" on_change="1" modifiers="{'readonly': [['state', 'not in', ['draft']]]}"/> -->
										</page>
										<page string="Payments">
											<field name="payment_ids" modifiers="{'readonly': true}"/>
										</page>
									</notebook>
								</sheet>
							</form>
                     	</field>
                     </page>
				</xpath>
			</field>
		</record>

		<record id="account_analytic_account_form_form_bf" model="ir.ui.view">
			<field name="name">account.analytic.account.invoice.form.bf</field>
			<field name="model">account.analytic.account</field>
			<field name="inherit_id" ref="hr_timesheet_invoice.account_analytic_account_form_form"/>
			<field name="arch" type="xml">
				<field name="use_timesheets" position='replace'>
					<field name="use_timesheets" invisible="1"/>
				</field>
				<button name="set_pending" position='replace'>
					<button name="set_pending" string="To Renew" type="object" invisible="1"/>
				</button>
				<button name="set_close" position='replace'>
					<button name="set_close" string="Close Contract" type="object" invisible="1"/>
				</button>
				<button name="set_open" position='replace'>
					<button name="set_open" string="Set In Progress" type="object" invisible="1"/>
				</button>
				<button name="set_cancel" position='replace'>
			     	<button name="set_cancel" string="Cancel Contract" type="object" invisible="1"/>
			     	<button name="%(batam_fast_module.act_reduction_adjustment)d" string="Create Reduction Adjustment" type="action" states="open,pending" groups="project.group_project_manager"/>
			     	<button name="%(batam_fast_module.create_invoice_analytic)d" string="Create Invoice" type="action" states="open" groups="project.group_project_manager"/>
			     	<button name="cust_quotation_print" string="Print Quotation" type="object"/>
			    </button>
				<field name="state" position="replace">
					<field name="state" readonly="1" widget="statusbar"
                            statusbar_visible="open,close" statusbar_colors='{"pending":"red", "template":"blue"}'/>
				</field>
				                        
			</field>
		</record>
	
		<record id="account_analytic_account_timesheet_form_bf" model="ir.ui.view">
			<field name="name">account.analytic.account.invoice.form.bf</field>
			<field name="model">account.analytic.account</field>
			<field name="inherit_id" ref="hr_timesheet.account_analytic_account_timesheet_form"/>
			<field name="arch" type="xml">
				<field name="use_timesheets" position='replace'>
					<field name="use_timesheets" invisible="1"/>
				</field>
				<label for="use_timesheets" position='replace'>
					<label for="use_timesheets" invisible="1"/>
				</label>
				<button name="%(hr_timesheet.act_analytic_cost_revenue)d"  position="replace">
					<button class="oe_inline oe_stat_button" type="action" name="%(hr_timesheet.act_analytic_cost_revenue)d" 
                        icon="fa-usd"  string="Cost/Revenue" widget="statinfo" invisible="1"/>
				</button>
				
			</field>
		</record>
		
		<act_window name="Create Invoice"
			res_model="hr.timesheet.invoice.create.final"
			src_model="account.analytic.account"
			view_mode="form"
			target="new"
			multi="True"
			groups="applico_v8.hidden_applico"
			key2="client_action_multi"
			id="hr_timesheet_invoice.action_hr_timesheet_invoice_create_final"/>
		
		<act_window name="Account Analytic Balance"
			res_model="account.analytic.balance"
			src_model="account.analytic.account"
			view_mode="form"
			target="new"
			multi="True"
			groups="applico_v8.hidden_applico"
			key2="client_print_multi"
			id="account.action_account_analytic_balance"/>

		<act_window name="Account Analytic Check"
			res_model="account.analytic.cost.ledger"
			src_model="account.analytic.account"
			view_mode="form"
			target="new"
			multi="True"
			groups="applico_v8.hidden_applico"
			key2="client_print_multi"
			id="account.action_account_analytic_cost"/>
		
		<act_window name="Account Analytic Inverted Balance"
			res_model="account.analytic.inverted.balance"
			src_model="account.analytic.account"
			view_mode="form"
			target="new"
			multi="True"
			groups="applico_v8.hidden_applico"
			key2="client_print_multi"
			id="account.action_account_analytic_invert_balance"/>

		<act_window name="Account Analytic Cost Ledger Journal"
			res_model="account.analytic.cost.ledger.journal.report"
			src_model="account.analytic.account"
			view_mode="form"
			target="new"
			multi="True"
			groups="applico_v8.hidden_applico"
			key2="client_print_multi"
			id="account.action_account_analytic_cost_ledger_journal"/>

	</data>
</openerp>


